package text;

import java.util.Arrays;

/**
 * @author The Setting sun
 * @create 2021-09-14 10:20
 */
public class t {
    public static void main(String[] args) {
        int[] nums = new int[]{2, 7, 11, 15};
        int target = 18;
        for(int i = 0; i < nums.length; i++){
            for(int j = i + 1; j < nums.length; j++){
                if(nums[i] + nums[j] == target){
                    System.out.println("[" + i + "," + j + "]");
                }
            }
        }
    }

}
